﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using IdeaNMR.Web.Core;
using Microsoft.Security.Application;
using IdeaNMR.Shared;

namespace IdeaNMR.Web
{
    public partial class DesignScript : DesignNMRObject_BasePage<Script>
    {
        protected override string PageTitle
        {
            get
            {
                return this.Master.Title;
            }
            set
            {
                this.Master.Title = value;
            }
        }

        #region Page Life Cycle
        #endregion

        protected override void SetValidationParameters()
        {
            base.SetValidationParameters();

            tbType.MaxLength = Sanitar.Type.MaxLength;
            rfvType.Text = revType.Text = Sanitar.Type.ErrorMsg;
            revType.ValidationExpression = Sanitar.Type.ValidationRegex;
        }

        protected override void CollectFormData()
        {
            base.CollectFormData();

            this.NMRObjectInfo.EntityObject.Type = this.tbType.Text;
            this.NMRObjectInfo.EntityObject.IsIncludable = this.chkbxIncludable.Checked;
        }

        protected override void UpdateFormData()
        {
            base.UpdateFormData();

            this.tbType.Text = this.NMRObjectInfo.EntityObject.Type;
            this.chkbxIncludable.Checked = this.NMRObjectInfo.EntityObject.IsIncludable;
        }
    }
}